﻿using System;
using Autodesk.Revit.DB;
using YJKRevitCode.ElmentSearchUtility.LinkDocumentSuite;
using SectionSignAndFilled.StairsRoomSection.DataDefine;
using SectionSignAndFilled.StairsRoomSection.Kit;

namespace SectionSignAndFilled.StairsRoomSection.ElementPacket
{
	internal class StairsLandingObject : ElementObject
	{
		public StairsLandingObject(BaseLinkDocumentResultBean LinkElem, SectionViewData secviewData = null) : base(LinkElem, secviewData)
		{
			this.m_objectType = ObjectType.kStairsLandingType;
		}

		public override void GetMaterial()
		{
			string strMaterial = "无";
			ElementId typeId = base.SelfElem.UseElement.GetTypeId();
			Element element = base.SelfElem.UseElement.Document.GetElement(typeId);
			Parameter parameter = element.get_Parameter(BuiltInParameter.STAIRS_LANDINGTYPE_LANDING_MATERIAL);
			base.SelfElem.UseElement.Document.GetElement(parameter.AsElementId());
			Material material = base.SelfElem.UseElement.Document.GetElement(parameter.AsElementId()) as Material;
			if (material != null)
			{
				strMaterial = material.Name;
			}
			this.m_strMaterial = strMaterial;
		}
	}
}
